using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace Dal.Models.Mapping
{
    public class WAITTEMPMap : EntityTypeConfiguration<WAITTEMP>
    {
        public WAITTEMPMap()
        {
            // Primary Key
            this.HasKey(t => new { t.PHONE, t.ID });

            // Properties
            this.Property(t => t.NAME)
                .HasMaxLength(50);

            this.Property(t => t.PHONE)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.STATE)
                .HasMaxLength(50);

            this.Property(t => t.CONTENT)
                .HasMaxLength(300);

            this.Property(t => t.STIME)
                .HasMaxLength(50);

            this.Property(t => t.PP)
                .HasMaxLength(50);

            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.OWNER)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("WAITTEMP");
            this.Property(t => t.NAME).HasColumnName("NAME");
            this.Property(t => t.PHONE).HasColumnName("PHONE");
            this.Property(t => t.STATE).HasColumnName("STATE");
            this.Property(t => t.CONTENT).HasColumnName("CONTENT");
            this.Property(t => t.STIME).HasColumnName("STIME");
            this.Property(t => t.PP).HasColumnName("PP");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.OWNER).HasColumnName("OWNER");

        }
    }
}
